perm filename DLIST.FAI[S,NET]1 blob
sn#846586 filedate 1987-10-04 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 TITLE DLIST A B C D P PDLEN PDL OFFSET RRLIST DATBEG OUTLEN RRREFC RRLENG RR.HDR RRTYPE RRCLAS RRTTL RRDLEN RRNAME DLIST DLIST1 DLDONE RROUT RROUT1 DOMOUT DOMOU1 TYPNAM CLSNAM RRDDSP UNIMPL D.UNK D.A D.A1 D.NS D.MD D.MF D.CNAME D.MB D.MG D.MR D.PTR D.SOA D.NULL D.WKS D.MINFO D.MX D.HINF D.HIN1 D.HIN2 DECOUT CPOPJ
C00010 ENDMK
C⊗;
TITLE DLIST ;⊗ A B C D P PDLEN PDL OFFSET RRLIST DATBEG OUTLEN RRREFC RRLENG RR.HDR RRTYPE RRCLAS RRTTL RRDLEN RRNAME DLIST DLIST1 DLDONE RROUT RROUT1 DOMOUT DOMOU1 TYPNAM CLSNAM RRDDSP UNIMPL D.UNK D.A D.A1 D.NS D.MD D.MF D.CNAME D.MB D.MG D.MR D.PTR D.SOA D.NULL D.WKS D.MINFO D.MX D.HINF D.HIN1 D.HIN2 DECOUT CPOPJ
;Type out contents of domain resource record cache in system.
A←1
B←2
C←3
D←4
P←17
PDLEN←40
PDL: BLOCK PDLEN
OFFSET: BLOCK 1 ;System addr → high segment offset
RRLIST: BLOCK 1 ;Addr of RRLIST in system
DATBEG: BLOCK 1 ;Ptr to beginning of data in a record
OUTLEN: BLOCK 1 ;Output string length
;Resource record definitions from system.
;Resource record header words (not seen by user code). Link word must
;be word 0.
RRREFC←←1 ;Reference count
RRLENG←←2 ;<LH of byte pos>,,<word count>
RR.HDR←←3 ;Total number of header words
;Format of a resource record (as seen by user code and stored in cache).
;The name is stored in 8-bit domain format (see RFC 883), though never in
;the "compressed" format. It is followed by the associated data.
RRTYPE←←0 ;Type
RRCLAS←←1 ;Class
RRTTL←←2 ;Time to live (in seconds)
RRDLEN←←3 ;Data length (in bytes), or immediate data
RRNAME←←4 ;Start of name
TY.ALL←←=255
DLIST: RESET
MOVE P,[IOWD PDLEN,PDL]
MOVEI A,265 ;Low core ptr to SYSTOP
PEEK A,
PEEK A,
ANDCMI A,1777 ;Round down to K boundary
MOVEI B,400000 ;Compute offset for FS addresses
SUBI B,(A)
MOVEM B,OFFSET
HRLI A,377777(A) ;End address for SETPR2
SETPR2 A, ;Map system FS into high segment
JRST 4,.
MOVEI A,[RADIX50 0,RRLIST ↔ 0]
.SYML A,
JRST 4,.
MOVEM A,RRLIST
PEEK A, ;Get pointers from RRLIST
DLIST1: HRRZ A,A ;Forward pointer
CAMN A,RRLIST
JRST DLDONE ;All done
ADD A,OFFSET
PUSHJ P,RROUT
MOVE A,(A) ;Pointers
JRST DLIST1
DLDONE: EXIT
RROUT: MOVE B,RR.HDR+RRTTL(A) ;TTL in seconds
IDIVI B,=60 ;B←minutes, C←seconds
IDIVI B,=60 ;B←hours, C←minutes
PUSH P,C
CAIGE B,=10
OUTCHR [" "]
PUSHJ P,DECOUT ;Type hours
OUTCHR [":"]
POP P,B
CAIGE B,=10
OUTCHR ["0"]
PUSHJ P,DECOUT ;Type minutes
OUTCHR [11]
SETZM OUTLEN
MOVE B,[POINT 8,RR.HDR+RRNAME(A)]
PUSHJ P,DOMOUT
MOVEM B,DATBEG
MOVE C,OUTLEN
LSH C,-3
OUTCHR [11]
CAIGE C,3
AOJA C,.-2
MOVE B,RR.HDR+RRTYPE(A)
CAIE B,TY.ALL
OUTSTR @TYPNAM(B)
CAIN B,TY.ALL
OUTSTR [ASCIZ/* /]
MOVE B,RR.HDR+RRCLAS(A)
OUTSTR @CLSNAM(B)
SKIPL B,RR.HDR+RRDLEN(A) ;Skip if error record
JRST RROUT1
CAMN B,[-1]
OUTSTR [ASCIZ/-- name error --
/]
CAMN B,[-2]
OUTSTR [ASCIZ/-- soft error --
/]
CAMGE B,[-2]
OUTSTR [ASCIZ/-- unknown error type --
/]
POPJ P,
RROUT1: MOVE B,RR.HDR+RRTYPE(A)
PUSHJ P,@RRDDSP(B)
OUTSTR [ASCIZ/
/]
POPJ P,
DOMOUT: ILDB C,B ;Get a count
JUMPE C,CPOPJ
DOMOU1: ILDB D,B ;Get a data byte
OUTCHR D
AOS OUTLEN
SOJG C,DOMOU1
ILDB C,B ;Get next count
JUMPE C,CPOPJ
OUTCHR ["."]
AOS OUTLEN
JRST DOMOU1
TYPNAM: [ASCIZ/Unknown type/]
[ASCIZ/A /]
[ASCIZ/NS /]
[ASCIZ/MD /]
[ASCIZ/MF /]
[ASCIZ/CNAME/]
[ASCIZ/SOA/]
[ASCIZ/MB /]
[ASCIZ/MG /]
[ASCIZ/MR /]
[ASCIZ/NULL/]
[ASCIZ/WKS/]
[ASCIZ/PTR/]
[ASCIZ/HINFO/]
[ASCIZ/MINFO/]
[ASCIZ/MX /]
CLSNAM: [ASCIZ/ Unknown class /]
[ASCIZ/ IN /]
[ASCIZ/ CS /]
[ASCIZ/ CHAOS /]
RRDDSP: D.UNK
D.A
D.NS
D.MD
D.MF
D.CNAME
D.SOA
D.MB
D.MG
D.MR
D.NULL
D.WKS
D.PTR
D.HINFO
D.MINFO
D.MX
UNIMPL: OUTSTR [ASCIZ/??/]
POPJ P,
D.UNK: JRST UNIMPL
D.A:
repeat 0,<
MOVE B,RR.HDR+RRDLEN(A)
TLNN B,-1
JRST D.A1
LDB B,[POINT 8,RR.HDR+RRDLEN(A),11] ;1st address byte
PUSHJ P,DECOUT
OUTCHR ["."]
LDB B,[POINT 8,RR.HDR+RRDLEN(A),19] ;2nd address byte
PUSHJ P,DECOUT
OUTCHR ["."]
LDB B,[POINT 8,RR.HDR+RRDLEN(A),27] ;3rd address byte
PUSHJ P,DECOUT
OUTCHR ["."]
LDB B,[POINT 8,RR.HDR+RRDLEN(A),35] ;4th address byte
JRST DECOUT
D.A1:
>;repeat 0
ILDB B,DATBEG ;1st address byte
PUSHJ P,DECOUT
OUTCHR ["."]
ILDB B,DATBEG ;2nd address byte
PUSHJ P,DECOUT
OUTCHR ["."]
ILDB B,DATBEG ;3rd address byte
PUSHJ P,DECOUT
OUTCHR ["."]
ILDB B,DATBEG ;4th address byte
JRST DECOUT
D.NS:
D.MD:
D.MF:
D.CNAME:
D.MB:
D.MG:
D.MR:
D.PTR: MOVE B,DATBEG
JRST DOMOUT
D.SOA: JRST UNIMPL
D.NULL: JRST UNIMPL
D.WKS: JRST UNIMPL
D.MINFO:JRST UNIMPL
D.MX: ILDB B,DATBEG ;Get 2 bytes of preference value
ILDB C,DATBEG
LSH B,=8
ADD B,C
CAIGE B,=10
OUTCHR [" "]
PUSHJ P,DECOUT
OUTSTR [ASCIZ/ /]
MOVE B,DATBEG
JRST DOMOUT
D.HINF: ILDB B,DATBEG ;CPU name length
D.HIN1: ILDB C,DATBEG
OUTCHR C
SOJG B,D.HIN1
OUTSTR [ASCIZ/ /]
ILDB B,DATBEG ;OS name length
D.HIN2: ILDB C,DATBEG
OUTCHR C
SOJG B,D.HIN2
POPJ P,
DECOUT: IDIVI B,=10
PUSH P,C
JUMPE B,.+2
PUSHJ P,DECOUT
POP P,C
ADDI C,"0"
OUTCHR C
CPOPJ: POPJ P,
END DLIST